/*
** my_getnbr.c for  in /home/gueux_g/rendu/piscine/Jour_04
**
** Made by gregory gueux
** Login   <gueux_g@epitech.net>
**
** Started on  Thu Oct  4 16:59:06 2012 gregory gueux
** Last update Sat Oct 13 15:32:24 2012 gregory gueux
*/

int	my_getnbr(char *str)
{
  int	n;
  int	nbr;

  nbr = 0;
  n = -1;
  while (*str == '-' || *str == '+')
    {
      if (*str == '-')
	{
	  n = n * (-1);
	}
      str = str + 1;
    }
  while (*str >= '0' && *str <= '9')
    {
      nbr = (nbr + (*str - '0')) * 10;
      str = str + 1;
    }
  nbr = nbr / 10;
  if (n == 1)
    {
      nbr = -nbr;
    }
  return (nbr);
}
